﻿using BathhouseService.Models.SqlModels;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using System;
using System.Collections.Generic;
using System.Linq;
using WalkingTec.Mvvm.Core;

namespace BathhouseService
{
    public class DataContext : FrameworkContext
    {
        public DataContext(CS cs)
             : base(cs)
        {
        }
        public DataContext(string cs, DBTypeEnum dbtype, string version=null)
             : base(cs, dbtype, version)
        {
        }
        /// <summary>
        /// 增值服务
        /// </summary>
        public DbSet<ValueAddedServices> ValueAddedServicess { get; set; }
        /// <summary>
        /// 支付方式
        /// </summary>
        public DbSet<PayWay> PayWays { get; set; }
        /// <summary>
        /// 支付记录
        /// </summary>
        public DbSet<PaymentRecord> PaymentRecords { get; set; }
        /// <summary>
        /// 套餐信息
        /// </summary>
        public DbSet<PackageService> PackageServices { get; set; }
        /// <summary>
        /// 充值记录
        /// </summary>
        public DbSet<RechargeRecord> RechargeRecords { get; set; }
        /// <summary>
        /// 服务记录
        /// </summary>
        public DbSet<ServiceRecord> ServiceRecords { get; set; }
        /// <summary>
        /// 套餐设置
        /// </summary>
        public DbSet<PackageServiceSettings> PackageServiceSettingss { get; set; }
        /// <summary>
        /// 用户拥有服务
        /// </summary>
        public DbSet<ServiceAcquired> ServiceAcquireds { get; set; }
        /// <summary>
        /// 首页轮播图设置
        /// </summary>
        public DbSet<ShufflingFigure> ShufflingFigures { get; set; }
        /// <summary>
        /// 通知公告
        /// </summary>
        public DbSet<Notice> Notices { get; set; }
        /// <summary>
        /// 公告评论
        /// </summary>
        public DbSet<AnnouncementComments> AnnouncementCommentses { get; set; }

    }
    /// <summary>
    /// 为EF的Migration准备的辅助类，填写完整连接字符串和数据库类型
    /// 就可以使用Add-Migration和Update-Database了
    /// </summary>
    public class DataContextFactory : IDesignTimeDbContextFactory<DataContext>
    {
        public DataContext CreateDbContext(string[] args)
        {
            return new DataContext(@"Server=DESKTOP-ATT1EOK;Database=BathhouseService_db;Trusted_Connection=True;", DBTypeEnum.SqlServer);
        }
    }

}
